.navbar {
  width: 200px;
  background-color: $navbar-bg-light;
  color: #ffffff;
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  bottom: 0;
  border: none;
  border-radius: 0;
  margin: 0;
  outline:none;
  word-break:keep-all;
  white-space: nowrap;
  @include transition(width 0.7s ease-in-out);
  .navbar-head {
    height: 50px;
    width: 100%;
    overflow: hidden;
    background-color: $logo-bg-light;

    .navbar-brand {
      display: block;
      height: 50px;
      @include transition(padding-left 0.7s ease-in-out);
      .navbar-logo {
        width: 170px;
        height: 40px;
        display: block;
        margin-top: -10px;
        background-position: 0px -102px;
        background-repeat: no-repeat;
        line-height: 40px;
        color: #fff;
        font-size: 28px;
        /**background-image: url(./images/logo.svg);**/
      }
    }
  }

  .navbar-section {
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
  }

  .navbar-title{
    height: 40px;
    line-height: 40px;
    padding-left: 20px;
    color: $home-font-color;
    font-size: 12px;
    word-break: keep-all;
    white-space: nowrap;
    @include transition(padding-left 0.7s ease-in-out);
  }
  .navbar-items>li{
    position: relative;
    outline: none;
    cursor: pointer;
    &:focus{
      outline: none;
    }
    &:not(.has-secondary):hover{
      >a span{
        color: $blue-color;
      }
    }
    >a{
      position: relative;
      display: block;
      color: $white-color;
      padding: 11px 20px;
      text-decoration: none;
      font-size: 13px;
      overflow: hidden;
      .icon{
        display: inline-block;
        height: 16px;
        width: 16px;
        background: url(./images/icon.svg) no-repeat 0 -41px;
        margin: 0 20px -3px 0;
        &.icon-node{
          background-position-x: -16px;
        }
        &.icon-service{
          background-position-x: -33px;
        }
        &.icon-log{
          background-position-x: -49px;
        }
        &.icon-monitor{
          background-position-x: -65px;
        }
        &.icon-system{
          background-position-x: -82px;
        }
        &.icon-package{
          background-position-x: -101px;
        }
        &.icon-user{
          background-position-x: -120px;
        }
        &.icon-resource{
          background-position-x: -137px;
        }
      }
      .fa{
        position: absolute;
        right: 20px;
        margin-top: 3px;
        font-size: 10px;
        opacity: 1;
        @include transition(transform 0.4s, opacity 0.3s);
      }
    }
    &.active{
      >a{
        background-color: $bg-light-first;
        color: $blue-color;
      }
      ul{
        height: auto;
      }
    }
    &.open{
      .fa{
        transform: rotate(-180deg);
      }
    }
    &.active.has-secondary{
      >a{
        background-color: transparent;
        color: $white-color;
      }
    }
    ul{
      position: relative;
      height: 0;
      overflow: hidden;
      background-color: transparent;
      @include transition(0.3s ease-in-out all);
      li{
        a{
          display: block;
          color: $white-color;
          padding: 11px 20px 11px 55px;
          font-size: 10px;
          border-color: transparent;
          span:before{
            content: '';
            display: inline-block;
            margin-right: 8px;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background-color: #fff;
            border: 1px solid #fff;
          }
        }
        &:hover{
          a{
            color: $blue-color;
          }
        }
        &.active{
          a{
            background-color: $bg-light-first;
            color: #2f749a;
            span:before{
              background-color: $navbar-bg-light;
              border-color: $navbar-bg-light;
            }
          }
        }
      }
    }
  }
  .navbar-global{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 1px solid $bg-level-first;
    background-color: $navbar-bg-color;
    height: 50px;
    width:200px;
    @include transition(width 0.7s ease-in-out);
    >li{
      height: 50px;
      line-height: 50px;
      @include transition(width 0.7s ease-in-out);
      &:first-child{
        width:70px;
        text-align: center;
        overflow: hidden;
      }
      &:last-child{
        border-left: 1px solid $bg-level-first;
        width: 130px;
        .dropdown-toggle{
          padding: 0 10px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          word-break: break-all;
        }
      }
      span{
        color: $white-color;
        cursor: default;
      }
      .dropdown-menu{
        margin: 0;
        padding: 0;
        border: none;
        background-color: $bg-level-first;
        max-height: 210px;
        min-width: 130px;
        overflow: auto;
        right: 0;
        border-radius: 0;
        li{
          max-width: 130px;
          white-space: nowrap;
          a{
            padding: 8px 20px;
          }
          a:hover{
            color: $blue-color;
            background-color: transparent;
          }
        }
      }
      a{
        color: $white-color;
      }
    }
    li:last-child{
      border-right: none;
    }
  }
}

.navbar.narrow{
  width: 55px;
  .navbar-brand {
    padding-left: 12px;
  }
  .navbar-title{
    padding-left: 10px;
  }
  .navbar-items{
    >li{
      >a{
        .fa{
          opacity: 0;
        }
      }
      &.active.has-secondary{
        >a{
          background-color: $bg-light-first;
        }
      }
      ul{
        position: absolute;
        display: none;
        overflow: initial;
        margin-left: 5px;
        height: initial!important;
        left: 100%;
        top: 0;
        border: 1px solid rgba(0,0,0,0.15);
        border-radius: 4px;
        background-color: #fff;
        &:before{
          content: '';
          position: absolute;
          top: 10px;
          left: -16px;
          width: 0;
          height: 0;
          border: 10px solid transparent;
          border-right-color: #fff;
        }
        li{
          a{
            padding-left: 20px;
            color: #333;
            &:hover{
              color: $blue-color;
            }
          }
          span:before{
            border-color: #aaa;
            background-color: #aaa;
          }
          &.active{
            a{
              background-color: transparent;
              color: $blue-color;
            }
            span:before{
              border-color: $blue-color;
              background-color: $blue-color;
            }
          }
        }
      }
    }
  }
  .navbar-global{
    width: 55px;
    li{
      &:first-child{
        width: 0px;
      }
      &:last-child{
        border: 0;
        width: 55px;
      }
    }
  }
}
